Skip to content

feat: use mobilecli ios device#271

Open
kvs-coder wants to merge 2 commits into
mainfrom
vk/use-mobilecli-device
Open

feat: use mobilecli ios device#271
kvs-coder wants to merge 2 commits into
mainfrom
vk/use-mobilecli-device

Conversation

@kvs-coder
Copy link
Copy Markdown

@kvs-coder kvs-coder commented Feb 24, 2026

Summary by CodeRabbit

  • Refactor
    • Simplified iOS device handling implementation by switching to a more generic mobile device handler.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b854f9d3-2a02-4c46-98cb-2ec62da74858

📥 Commits

Reviewing files that changed from the base of the PR and between b9eace8 and ef998cf.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • package.json

Walkthrough

The iOS device handler in getRobotFromDevice now returns a MobileDevice instance instead of constructing an IosRobot. The import from ./ios was adjusted to remove IosRobot while retaining IosManager. The fast-xml-parser dependency range in package.json was widened from 5.3.8 to ^5.5.6. No new exports were added.

Changes

Cohort / File(s) Summary
Device Handler Refactoring
src/server.ts
Changed iOS device instantiation from IosRobot to MobileDevice in getRobotFromDevice. Updated imports to remove IosRobot from the ./ios module while keeping IosManager.
Dependency update
package.json
Updated fast-xml-parser version constraint from 5.3.8 to ^5.5.6.
🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author. Add a pull request description explaining the rationale for switching from IosRobot to MobileDevice and any impacts of this change.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: replacing IosRobot with MobileDevice for iOS device handling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vk/use-mobilecli-device
📝 Coding Plan
  • Generate coding plan for human review comments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/server.ts (1)

154-159: ⚠️ Potential issue | 🟠 Major

Incompatible device IDs between go-ios and mobilecli for physical iOS devices.

Physical iOS devices use IosManager.listDevices() which returns go-ios UDIDs, but these are passed directly to MobileDevice which sends them to mobilecli --device. However, simulator handling uses mobilecli.getDevices() and passes mobilecli's own device IDs, suggesting the two tools use incompatible ID formats. This will cause MobileDevice commands to fail for real iOS devices. Either verify the formats are compatible or use mobilecli.getDevices() with type: "real" for physical iOS devices instead of querying go-ios.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/server.ts` around lines 154 - 159, The code uses IosManager.listDevices()
UDIDs and then constructs a MobileDevice(deviceId), but go-ios UDIDs differ from
mobilecli device IDs causing MobileDevice commands to fail; update the logic to
query mobilecli.getDevices({ type: "real" }) (or call mobilecli.getDevices() and
filter real devices) and find the matching device by comparing the mobilecli
device id to deviceId, then pass that mobilecli id into new MobileDevice(...)
instead of using IosManager.listDevices(); references: IosManager.listDevices(),
iosManager, MobileDevice, and mobilecli.getDevices().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/server.ts`:
- Around line 154-159: The code uses IosManager.listDevices() UDIDs and then
constructs a MobileDevice(deviceId), but go-ios UDIDs differ from mobilecli
device IDs causing MobileDevice commands to fail; update the logic to query
mobilecli.getDevices({ type: "real" }) (or call mobilecli.getDevices() and
filter real devices) and find the matching device by comparing the mobilecli
device id to deviceId, then pass that mobilecli id into new MobileDevice(...)
instead of using IosManager.listDevices(); references: IosManager.listDevices(),
iosManager, MobileDevice, and mobilecli.getDevices().

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46cf148 and 17efa43.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • src/server.ts

@kvs-coder kvs-coder force-pushed the vk/use-mobilecli-device branch from 17efa43 to a35c325 Compare March 2, 2026 12:47
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/server.ts (1)

146-183: ⚠️ Potential issue | 🔴 Critical

MobileDevice does not fully support physical iOS devices — critical functionality is missing.

The change replaces IosRobot with MobileDevice for physical iOS devices (line 156), but MobileDevice lacks essential capabilities:

  • Missing getIosVersion() method that IosRobot provides
  • No tunnel management or WebDriverAgent infrastructure that physical devices require (especially iOS 17+)
  • Different backend: IosRobot uses go-ios + WebDriverAgent, while MobileDevice only uses mobilecli

MobileDevice was designed as a unified class for simulators and Android devices using mobilecli, not as a replacement for physical iOS device handling. This change will break physical iOS device operations.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/server.ts` around lines 146 - 183, getRobotFromDevice currently returns a
MobileDevice for physical iOS devices (using IosManager to detect them) but
MobileDevice lacks key iOS-specific features (getIosVersion, tunnel/WDA
management and go-ios backend) so revert the change: when IosManager finds a
physical device return an IosRobot (not MobileDevice); leave MobileDevice for
simulators only (the mobilecli branch and simulator detection using
mobilecli.getDevices). If you cannot instantiate IosRobot directly, delegate
iOS-specific calls from MobileDevice to an IosRobot instance or implement
missing methods (getIosVersion, tunnel/WDA setup) in MobileDevice to match
IosRobot behavior; update references to IosManager, MobileDevice, IosRobot and
getRobotFromDevice accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@src/server.ts`:
- Around line 146-183: getRobotFromDevice currently returns a MobileDevice for
physical iOS devices (using IosManager to detect them) but MobileDevice lacks
key iOS-specific features (getIosVersion, tunnel/WDA management and go-ios
backend) so revert the change: when IosManager finds a physical device return an
IosRobot (not MobileDevice); leave MobileDevice for simulators only (the
mobilecli branch and simulator detection using mobilecli.getDevices). If you
cannot instantiate IosRobot directly, delegate iOS-specific calls from
MobileDevice to an IosRobot instance or implement missing methods
(getIosVersion, tunnel/WDA setup) in MobileDevice to match IosRobot behavior;
update references to IosManager, MobileDevice, IosRobot and getRobotFromDevice
accordingly.

ℹ️ Review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 17efa43 and a35c325.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • src/server.ts

@kvs-coder kvs-coder force-pushed the vk/use-mobilecli-device branch from a35c325 to b9eace8 Compare March 18, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant